this.BX=this.BX||{};this.BX.Location=this.BX.Location||{};(function(e,t,a){"use strict";function r(e,t,a,r){if(e!==t){throw new TypeError("Private static access of wrong provenance")}if(a.set){a.set.call(e,r)}else{if(!a.writable){throw new TypeError("attempted to set read only private field")}a.value=r}return r}function i(e,t,a){if(e!==t){throw new TypeError("Private static access of wrong provenance")}if(a.get){return a.get.call(e)}return a.value}function l(e,t,a){if(e!==t){throw new TypeError("Private static access of wrong provenance")}return a}var s=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"load",value:function t(a,s){if(i(e,e,b)===null){r(e,e,b,new Promise(function(t){BX.load([l(e,e,o).call(e,a,s)],function(){t()})}))}return i(e,e,b)}}]);return e}();var n=function e(t){var a={en:"US",uk:"UA",zh:"CN",ja:"JP",vi:"VN",ms:"MY",hi:"IN"};return typeof a[t]!=="undefined"?a[t]:t.toUpperCase()};var o=function e(t,a){return"https://maps.googleapis.com/maps/api/js"+"?key=".concat(t)+"&libraries=places"+"&language=".concat(a)+"&region=".concat(l(this,s,n).call(this,a))};var b={writable:true,value:null};function u(e,t){var a;if(typeof Symbol==="undefined"||e[Symbol.iterator]==null){if(Array.isArray(e)||(a=c(e))||t&&e&&typeof e.length==="number"){if(a)e=a;var r=0;var i=function e(){};return{s:i,n:function t(){if(r>=e.length)return{done:true};return{done:false,value:e[r++]}},e:function e(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l=true,s=false,n;return{s:function t(){a=e[Symbol.iterator]()},n:function e(){var t=a.next();l=t.done;return t},e:function e(t){s=true;n=t},f:function e(){try{if(!l&&a.return!=null)a.return()}finally{if(s)throw n}}}}function c(e,t){if(!e)return;if(typeof e==="string")return d(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);if(a==="Object"&&e.constructor)a=e.constructor.name;if(a==="Map"||a==="Set")return Array.from(e);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return d(e,t)}function d(e,t){if(t==null||t>e.length)t=e.length;for(var a=0,r=new Array(t);a<t;a++){r[a]=e[a]}return r}function p(e,t,a){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return a}var v=new WeakMap;var f=new WeakMap;var h=new WeakMap;var H=new WeakMap;var g=new WeakMap;var w=new WeakMap;var P=new WeakMap;var y=new WeakSet;var T=new WeakSet;var m=new WeakSet;var I=new WeakSet;var S=new WeakSet;var F=new WeakSet;var G=new WeakSet;var k=new WeakSet;var z=function(e){babelHelpers.inherits(t,e);function t(e){var a;babelHelpers.classCallCheck(this,t);a=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this,e));k.add(babelHelpers.assertThisInitialized(a));G.add(babelHelpers.assertThisInitialized(a));F.add(babelHelpers.assertThisInitialized(a));S.add(babelHelpers.assertThisInitialized(a));I.add(babelHelpers.assertThisInitialized(a));m.add(babelHelpers.assertThisInitialized(a));T.add(babelHelpers.assertThisInitialized(a));y.add(babelHelpers.assertThisInitialized(a));v.set(babelHelpers.assertThisInitialized(a),{writable:true,value:void 0});f.set(babelHelpers.assertThisInitialized(a),{writable:true,value:void 0});h.set(babelHelpers.assertThisInitialized(a),{writable:true,value:void 0});H.set(babelHelpers.assertThisInitialized(a),{writable:true,value:void 0});g.set(babelHelpers.assertThisInitialized(a),{writable:true,value:"locationGoogleAutocomplete"});w.set(babelHelpers.assertThisInitialized(a),{writable:true,value:30});P.set(babelHelpers.assertThisInitialized(a),{writable:true,value:5e4});babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(a),v,e.languageId);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(a),H,e.googleSource);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(a),h,e.googleSource.loaderPromise.then(function(){p(babelHelpers.assertThisInitialized(a),F,E).call(babelHelpers.assertThisInitialized(a))}));return a}babelHelpers.createClass(t,[{key:"autocomplete",value:function e(t,a){var r=this;if(t===""){return new Promise(function(e){e([])})}return babelHelpers.classPrivateFieldGet(this,h).then(function(){return p(r,S,O).call(r,t,a)},function(e){return BX.debug(e)})}}]);return t}(a.AutocompleteServiceBase);var L=function e(t,a){var r=null;var i=p(this,m,C).call(this);var l=u(i.entries()),s;try{for(l.s();!(s=l.n()).done;){var n=babelHelpers.slicedToArray(s.value,2),o=n[0],b=n[1];if(b&&typeof b.query!=="undefined"&&b.query===t){r=babelHelpers.objectSpread({},b);break}}}catch(e){l.e(e)}finally{l.f()}return r};var _=function e(t,a){var r=this;var i=null;var l=p(this,y,L).call(this,t,a);if(l!==null){i=new Promise(function(e){e(p(r,G,A).call(r,l.answer,l.status))})}return i};var C=function e(){var t=BX.localStorage.get(babelHelpers.classPrivateFieldGet(this,g));if(t&&t.results&&Array.isArray(t.results)){return t.results}return[]};var M=function e(t,a,r,i){var l=p(this,m,C).call(this);l.push({status:i,query:t,answer:r});if(l.length>babelHelpers.classPrivateFieldGet(this,w)){l.shift()}BX.localStorage.set(babelHelpers.classPrivateFieldGet(this,g),{results:l},86400)};var O=function e(t,a){var r=this;var i=p(this,T,_).call(this,t,a);if(!i){var l={input:t};if(a.biasPoint){l.location=new google.maps.LatLng(a.biasPoint.latitude,a.biasPoint.longitude);l.radius=babelHelpers.classPrivateFieldGet(this,P)}i=new Promise(function(e){babelHelpers.classPrivateFieldGet(r,f).getQueryPredictions(l,function(i,l){var s=p(r,G,A).call(r,i,l);p(r,I,M).call(r,t,a,i,l);e(s)})})}return i};var E=function e(){if(typeof google==="undefined"||typeof google.maps.places.AutocompleteService==="undefined"){throw new Error("google.maps.places.AutocompleteService must be defined")}babelHelpers.classPrivateFieldSet(this,f,new google.maps.places.AutocompleteService)};var A=function e(t,r){if(r==="ZERO_RESULTS"){return[]}if(!t||r!=="OK"){return false}var i=[];var l=u(t),s;try{for(l.s();!(s=l.n()).done;){var n=s.value;if(n.place_id){var o=void 0;if(n.structured_formatting&&n.structured_formatting.main_text){o=n.structured_formatting.main_text}else{o=n.description}var b=new a.Location({sourceCode:babelHelpers.classPrivateFieldGet(this,H).sourceCode,externalId:n.place_id,name:o,languageId:babelHelpers.classPrivateFieldGet(this,v)});if(n.structured_formatting&&n.structured_formatting.secondary_text){b.setFieldValue(a.LocationType.TMP_TYPE_CLARIFICATION,n.structured_formatting.secondary_text)}var c=p(this,k,W).call(this,n.types);if(c){b.setFieldValue(a.LocationType.TMP_TYPE_HINT,p(this,k,W).call(this,n.types))}i.push(b)}}}catch(e){l.e(e)}finally{l.f()}return i};var W=function e(a){var r="";if(a.indexOf("locality")>=0){r=t.Loc.getMessage("LOCATION_GOO_AUTOCOMPLETE_TYPE_LOCALITY")}else if(a.indexOf("sublocality")>=0){r=t.Loc.getMessage("LOCATION_GOO_AUTOCOMPLETE_TYPE_SUBLOCAL")}else if(a.indexOf("store")>=0){r=t.Loc.getMessage("LOCATION_GOO_AUTOCOMPLETE_TYPE_STORE")}else if(a.indexOf("restaurant")>=0){r=t.Loc.getMessage("LOCATION_GOO_AUTOCOMPLETE_TYPE_RESTAURANT")}else if(a.indexOf("cafe")>=0){r=t.Loc.getMessage("LOCATION_GOO_AUTOCOMPLETE_TYPE_CAFE")}return r};function U(e,t,a){if(e!==t){throw new TypeError("Private static access of wrong provenance")}if(a.get){return a.get.call(e)}return a.value}function B(e,t,a){if(e!==t){throw new TypeError("Private static access of wrong provenance")}return a}function R(e,t,a){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return a}var x=new WeakMap;var N=new WeakMap;var Y=new WeakMap;var j=new WeakMap;var X=new WeakMap;var D=new WeakMap;var K=new WeakMap;var V=new WeakMap;var q=new WeakMap;var Z=new WeakMap;var $=new WeakMap;var J=new WeakMap;var Q=new WeakMap;var ee=new WeakSet;var te=new WeakSet;var ae=new WeakSet;var re=new WeakSet;var ie=new WeakSet;var le=new WeakSet;var se=new WeakSet;var ne=new WeakSet;var oe=new WeakSet;var be=function(e){babelHelpers.inherits(r,e);function r(e){var t;babelHelpers.classCallCheck(this,r);t=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(r).call(this,e));oe.add(babelHelpers.assertThisInitialized(t));ne.add(babelHelpers.assertThisInitialized(t));se.add(babelHelpers.assertThisInitialized(t));le.add(babelHelpers.assertThisInitialized(t));ie.add(babelHelpers.assertThisInitialized(t));re.add(babelHelpers.assertThisInitialized(t));ae.add(babelHelpers.assertThisInitialized(t));te.add(babelHelpers.assertThisInitialized(t));ee.add(babelHelpers.assertThisInitialized(t));x.set(babelHelpers.assertThisInitialized(t),{writable:true,value:void 0});N.set(babelHelpers.assertThisInitialized(t),{writable:true,value:void 0});Y.set(babelHelpers.assertThisInitialized(t),{writable:true,value:void 0});j.set(babelHelpers.assertThisInitialized(t),{writable:true,value:void 0});X.set(babelHelpers.assertThisInitialized(t),{writable:true,value:void 0});D.set(babelHelpers.assertThisInitialized(t),{writable:true,value:void 0});K.set(babelHelpers.assertThisInitialized(t),{writable:true,value:void 0});V.set(babelHelpers.assertThisInitialized(t),{writable:true,value:void 0});q.set(babelHelpers.assertThisInitialized(t),{writable:true,value:void 0});Z.set(babelHelpers.assertThisInitialized(t),{writable:true,value:null});$.set(babelHelpers.assertThisInitialized(t),{writable:true,value:false});J.set(babelHelpers.assertThisInitialized(t),{writable:true,value:void 0});Q.set(babelHelpers.assertThisInitialized(t),{writable:true,value:null});babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(t),x,e.languageId);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(t),Y,e.googleSource);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(t),q,e.locationRepository||new a.LocationRepository);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(t),J,e.changeDelay||700);return t}babelHelpers.createClass(r,[{key:"render",value:function e(t){var a=this;babelHelpers.classPrivateFieldSet(this,Q,babelHelpers.classPrivateFieldGet(this,Y).loaderPromise.then(function(){R(a,oe,Pe).call(a,t)}));return babelHelpers.classPrivateFieldGet(this,Q)}},{key:"onLocationChangedEventSubscribe",value:function e(t){this.subscribe(U(r,r,ce),t)}},{key:"destroy",value:function e(){t.Event.unbindAll(this);babelHelpers.classPrivateFieldSet(this,N,null);babelHelpers.classPrivateFieldSet(this,X,null);babelHelpers.classPrivateFieldSet(this,V,null);babelHelpers.classPrivateFieldSet(this,Z,null);babelHelpers.classPrivateFieldSet(this,Q,null);babelHelpers.get(babelHelpers.getPrototypeOf(r.prototype),"destroy",this).call(this)}},{key:"loaderPromise",get:function e(){return babelHelpers.classPrivateFieldGet(this,Q)}},{key:"mode",set:function e(t){babelHelpers.classPrivateFieldSet(this,D,t);if(babelHelpers.classPrivateFieldGet(this,X)){babelHelpers.classPrivateFieldGet(this,X).setDraggable(t===a.ControlMode.edit)}}},{key:"zoom",get:function e(){return babelHelpers.classPrivateFieldGet(this,j)},set:function e(t){babelHelpers.classPrivateFieldSet(this,j,t);if(babelHelpers.classPrivateFieldGet(this,N)){babelHelpers.classPrivateFieldGet(this,N).setZoom(t)}}},{key:"location",set:function e(t){babelHelpers.classPrivateFieldSet(this,K,t);var a=R(this,ee,de).call(this,t);if(a){if(babelHelpers.classPrivateFieldGet(this,X)){babelHelpers.classPrivateFieldSet(this,$,true);babelHelpers.classPrivateFieldGet(this,X).setPosition(a);babelHelpers.classPrivateFieldSet(this,$,false)}if(babelHelpers.classPrivateFieldGet(this,N)){if(!babelHelpers.classPrivateFieldGet(this,X).getMap()){babelHelpers.classPrivateFieldGet(this,X).setMap(babelHelpers.classPrivateFieldGet(this,N))}babelHelpers.classPrivateFieldGet(this,N).panTo(a)}}else{if(babelHelpers.classPrivateFieldGet(this,X)){babelHelpers.classPrivateFieldGet(this,X).setMap(null)}}R(this,te,pe).call(this)},get:function e(){return babelHelpers.classPrivateFieldGet(this,K)}},{key:"googleMap",get:function e(){return babelHelpers.classPrivateFieldGet(this,N)}}]);return r}(a.MapBase);var ue=function e(t){var a=18;if(t){var r=t.type;if(r>0){if(r<100)a=1;else if(r===100)a=4;else if(r<=200)a=6;else if(r<=300)a=11;else if(r<=340)a=16;else if(r>340)a=18}}return a};var ce={writable:true,value:"onChanged"};var de=function e(t){if(!t){return null}if(typeof google==="undefined"||typeof google.maps==="undefined"){return null}return new google.maps.LatLng(t.latitude,t.longitude)};var pe=function e(){if(!babelHelpers.classPrivateFieldGet(this,K)){return}var t=B(be,be,ue).call(be,babelHelpers.classPrivateFieldGet(this,K));if(t!==null&&t!==babelHelpers.classPrivateFieldGet(this,j)){this.zoom=t}};var ve=function e(t){var a=this;return new Promise(function(e){babelHelpers.classPrivateFieldGet(a,V).geocode({location:t},function(t,a){if(a==="OK"&&t[0]){e(t[0].place_id)}else if(a==="ZERO_RESULTS"){e("")}else{throw Error("Geocoder failed due to: "+a)}})}).then(function(e){var t;if(e){t=babelHelpers.classPrivateFieldGet(a,q).findByExternalId(e,babelHelpers.classPrivateFieldGet(a,Y).sourceCode,babelHelpers.classPrivateFieldGet(a,x))}else{t=new Promise(function(e){e(null)})}return t})};var fe=function e(t){if(babelHelpers.classPrivateFieldGet(this,D)===a.ControlMode.edit){this.emit(U(be,be,ce),{location:t})}};var he=function e(){if(!babelHelpers.classPrivateFieldGet(this,$)&&babelHelpers.classPrivateFieldGet(this,D)===a.ControlMode.edit){R(this,le,He).call(this,babelHelpers.classPrivateFieldGet(this,X).getPosition())}};var He=function e(t){var a=this;if(babelHelpers.classPrivateFieldGet(this,Z)!==null){clearTimeout(babelHelpers.classPrivateFieldGet(this,Z))}babelHelpers.classPrivateFieldSet(this,Z,setTimeout(function(){babelHelpers.classPrivateFieldSet(a,Z,null);babelHelpers.classPrivateFieldGet(a,N).panTo(t);R(a,se,ge).call(a,t)},babelHelpers.classPrivateFieldGet(this,J)))};var ge=function e(t){R(this,ae,ve).call(this,t).then(R(this,re,fe).bind(this)).catch(function(e){a.ErrorPublisher.getInstance().notify(e.errors)})};var we=function e(t){if(babelHelpers.classPrivateFieldGet(this,D)===a.ControlMode.edit){if(!babelHelpers.classPrivateFieldGet(this,X).getMap){babelHelpers.classPrivateFieldGet(this,X).setMap(babelHelpers.classPrivateFieldGet(this,N))}babelHelpers.classPrivateFieldGet(this,X).setPosition(t);R(this,le,He).call(this,t)}};var Pe=function e(t){var r=this;babelHelpers.classPrivateFieldSet(this,D,t.mode);babelHelpers.classPrivateFieldSet(this,K,t.location||null);if(typeof google==="undefined"||typeof google.maps.Map==="undefined"){throw new Error("google.maps.Map must be defined")}var i=R(this,ee,de).call(this,babelHelpers.classPrivateFieldGet(this,K));var l={gestureHandling:"greedy",disableDefaultUI:true,zoomControl:true,zoomControlOptions:{position:google.maps.ControlPosition.TOP_LEFT}};var s=B(be,be,ue).call(be,babelHelpers.classPrivateFieldGet(this,K));if(s){l.zoom=s}if(i){l.center=i}babelHelpers.classPrivateFieldSet(this,N,new google.maps.Map(t.mapContainer,l));babelHelpers.classPrivateFieldGet(this,N).addListener("click",function(e){R(r,ne,we).call(r,e.latLng)});if(typeof google.maps.Marker==="undefined"){throw new Error("google.maps.Marker must be defined")}babelHelpers.classPrivateFieldSet(this,X,new google.maps.Marker({position:i,map:babelHelpers.classPrivateFieldGet(this,N),draggable:babelHelpers.classPrivateFieldGet(this,D)===a.ControlMode.edit}));babelHelpers.classPrivateFieldGet(this,X).addListener("position_changed",function(){R(r,ie,he).call(r)});if(typeof google.maps.Geocoder==="undefined"){throw new Error("google.maps.Geocoder must be defined")}babelHelpers.classPrivateFieldSet(this,V,new google.maps.Geocoder)};function ye(e,t){var a;if(typeof Symbol==="undefined"||e[Symbol.iterator]==null){if(Array.isArray(e)||(a=Te(e))||t&&e&&typeof e.length==="number"){if(a)e=a;var r=0;var i=function e(){};return{s:i,n:function t(){if(r>=e.length)return{done:true};return{done:false,value:e[r++]}},e:function e(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l=true,s=false,n;return{s:function t(){a=e[Symbol.iterator]()},n:function e(){var t=a.next();l=t.done;return t},e:function e(t){s=true;n=t},f:function e(){try{if(!l&&a.return!=null)a.return()}finally{if(s)throw n}}}}function Te(e,t){if(!e)return;if(typeof e==="string")return me(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);if(a==="Object"&&e.constructor)a=e.constructor.name;if(a==="Map"||a==="Set")return Array.from(e);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return me(e,t)}function me(e,t){if(t==null||t>e.length)t=e.length;for(var a=0,r=new Array(t);a<t;a++){r[a]=e[a]}return r}function Ie(e,t,a){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return a}var Se=new WeakMap;var Fe=new WeakMap;var Ge=new WeakMap;var ke=new WeakMap;var ze=new WeakSet;var Le=function(e){babelHelpers.inherits(t,e);function t(e){var a;babelHelpers.classCallCheck(this,t);a=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this,e));ze.add(babelHelpers.assertThisInitialized(a));Se.set(babelHelpers.assertThisInitialized(a),{writable:true,value:void 0});Fe.set(babelHelpers.assertThisInitialized(a),{writable:true,value:void 0});Ge.set(babelHelpers.assertThisInitialized(a),{writable:true,value:void 0});ke.set(babelHelpers.assertThisInitialized(a),{writable:true,value:void 0});babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(a),Ge,e.googleSource);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(a),Se,e.map);return a}babelHelpers.createClass(t,[{key:"requestPhotos",value:function e(t){var a=this;return new Promise(function(e){var r=Ie(a,ze,_e).call(a);if(!r){e([])}var i=Ie(a,ze,_e).call(a);if(!i){e([])}i.then(function(){if(t.location.sourceCode!==babelHelpers.classPrivateFieldGet(a,Ge).sourceCode){e([]);return}if(t.location.externalId.length<=0){e([]);return}babelHelpers.classPrivateFieldGet(a,Fe).getDetails({placeId:t.location.externalId,fields:["photos"]},function(a,r){var i=[];if(r===google.maps.places.PlacesServiceStatus.OK){if(Array.isArray(a.photos)){var l=0;var s=ye(a.photos),n;try{for(s.s();!(n=s.n()).done;){var o=n.value;i.push({url:o.getUrl(),width:o.width,height:o.height,description:Array.isArray(o.html_attributions)?o.html_attributions.join("<br>"):"",thumbnail:{url:o.getUrl({maxHeight:t.thumbnailHeight,maxWidth:t.thumbnailWidth}),width:t.thumbnailWidth,height:t.thumbnailHeight}});l++;if(t.maxPhotoCount&&l>=t.maxPhotoCount){break}}}catch(e){s.e(e)}finally{s.f()}}}e(i)})})})}}]);return t}(a.PhotoServiceBase);var _e=function e(){var t=this;if(!babelHelpers.classPrivateFieldGet(this,ke)){if(babelHelpers.classPrivateFieldGet(this,Se).loaderPromise===null){return}babelHelpers.classPrivateFieldSet(this,ke,babelHelpers.classPrivateFieldGet(this,Se).loaderPromise.then(function(){babelHelpers.classPrivateFieldSet(t,Fe,new google.maps.places.PlacesService(babelHelpers.classPrivateFieldGet(t,Se).googleMap))}))}return babelHelpers.classPrivateFieldGet(this,ke)};function Ce(e,t){var a;if(typeof Symbol==="undefined"||e[Symbol.iterator]==null){if(Array.isArray(e)||(a=Me(e))||t&&e&&typeof e.length==="number"){if(a)e=a;var r=0;var i=function e(){};return{s:i,n:function t(){if(r>=e.length)return{done:true};return{done:false,value:e[r++]}},e:function e(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l=true,s=false,n;return{s:function t(){a=e[Symbol.iterator]()},n:function e(){var t=a.next();l=t.done;return t},e:function e(t){s=true;n=t},f:function e(){try{if(!l&&a.return!=null)a.return()}finally{if(s)throw n}}}}function Me(e,t){if(!e)return;if(typeof e==="string")return Oe(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);if(a==="Object"&&e.constructor)a=e.constructor.name;if(a==="Map"||a==="Set")return Array.from(e);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return Oe(e,t)}function Oe(e,t){if(t==null||t>e.length)t=e.length;for(var a=0,r=new Array(t);a<t;a++){r[a]=e[a]}return r}function Ee(e,t,a){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return a}var Ae=new WeakMap;var We=new WeakMap;var Ue=new WeakMap;var Be=new WeakMap;var Re=new WeakSet;var xe=new WeakSet;var Ne=new WeakSet;var Ye=function(e){babelHelpers.inherits(t,e);function t(e){var a;babelHelpers.classCallCheck(this,t);a=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this,e));Ne.add(babelHelpers.assertThisInitialized(a));xe.add(babelHelpers.assertThisInitialized(a));Re.add(babelHelpers.assertThisInitialized(a));Ae.set(babelHelpers.assertThisInitialized(a),{writable:true,value:void 0});We.set(babelHelpers.assertThisInitialized(a),{writable:true,value:void 0});Ue.set(babelHelpers.assertThisInitialized(a),{writable:true,value:void 0});Be.set(babelHelpers.assertThisInitialized(a),{writable:true,value:void 0});babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(a),Ae,e.map);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(a),Be,e.googleSource);return a}babelHelpers.createClass(t,[{key:"geocodeConcrete",value:function e(t){var a=this;return new Promise(function(e){var r=Ee(a,Re,je).call(a);if(!r){e([]);return}r.then(function(){babelHelpers.classPrivateFieldGet(a,We).geocode({address:t},function(t,r){if(r==="OK"){e(Ee(a,Ne,De).call(a,t))}else if(r==="ZERO_RESULTS"){e([])}else{BX.debug("Geocode was not successful for the following reason: ".concat(r))}})})})}}]);return t}(a.GeocodingServiceBase);var je=function e(){var t=this;if(!babelHelpers.classPrivateFieldGet(this,Ue)){if(babelHelpers.classPrivateFieldGet(this,Be).loaderPromise===null){return}babelHelpers.classPrivateFieldSet(this,Ue,babelHelpers.classPrivateFieldGet(this,Be).loaderPromise.then(function(){babelHelpers.classPrivateFieldSet(t,We,new google.maps.Geocoder)}))}return babelHelpers.classPrivateFieldGet(this,Ue)};var Xe=function e(t){var r={country:a.LocationType.COUNTRY,locality:a.LocationType.LOCALITY,postal_town:a.LocationType.LOCALITY,route:a.LocationType.STREET,street_address:a.LocationType.ADDRESS_LINE_1,administrative_area_level_4:a.LocationType.ADM_LEVEL_4,administrative_area_level_3:a.LocationType.ADM_LEVEL_3,administrative_area_level_2:a.LocationType.ADM_LEVEL_2,administrative_area_level_1:a.LocationType.ADM_LEVEL_1,floor:a.LocationType.FLOOR,postal_code:a.AddressType.POSTAL_CODE,room:a.LocationType.ROOM,sublocality:a.LocationType.SUB_LOCALITY,sublocality_level_1:a.LocationType.SUB_LOCALITY_LEVEL_1,sublocality_level_2:a.LocationType.SUB_LOCALITY_LEVEL_2,street_number:a.LocationType.BUILDING};var i=a.LocationType.UNKNOWN;var l=Ce(t),s;try{for(l.s();!(s=l.n()).done;){var n=s.value;if(typeof r[n]!=="undefined"){i=r[n];break}}}catch(e){l.e(e)}finally{l.f()}return i};var De=function e(t){var r=[];var i=Ce(t),l;try{for(i.s();!(l=i.n()).done;){var s=l.value;var n=new a.Location;n.sourceCode=babelHelpers.classPrivateFieldGet(this,Be).sourceCode;n.languageId=babelHelpers.classPrivateFieldGet(this,Be).languageId;n.externalId=s.place_id;n.type=Ee(this,xe,Xe).call(this,s.types);n.name=s.formatted_address;n.latitude=s.geometry.location.lat();n.longitude=s.geometry.location.lng();r.push(n)}}catch(e){i.e(e)}finally{i.f()}return r};var Ke=new WeakMap;var Ve=new WeakMap;var qe=new WeakMap;var Ze=new WeakMap;var $e=new WeakMap;var Je=new WeakMap;var Qe=new WeakMap;var et=function(e){babelHelpers.inherits(r,e);function r(e){var i;babelHelpers.classCallCheck(this,r);i=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(r).call(this,e));Ke.set(babelHelpers.assertThisInitialized(i),{writable:true,value:""});Ve.set(babelHelpers.assertThisInitialized(i),{writable:true,value:""});qe.set(babelHelpers.assertThisInitialized(i),{writable:true,value:null});Ze.set(babelHelpers.assertThisInitialized(i),{writable:true,value:void 0});$e.set(babelHelpers.assertThisInitialized(i),{writable:true,value:void 0});Je.set(babelHelpers.assertThisInitialized(i),{writable:true,value:void 0});Qe.set(babelHelpers.assertThisInitialized(i),{writable:true,value:void 0});if(!t.Type.isString(e.languageId)||e.languageId.trim()===""){throw new a.SourceCreationError("props.languageId must be a string")}babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(i),Ke,e.languageId);if(!t.Type.isString(e.sourceLanguageId)||e.sourceLanguageId.trim()===""){throw new a.SourceCreationError("props.sourceLanguageId must be a string")}babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(i),Ve,e.sourceLanguageId);if(!t.Type.isString(e.apiKey)||e.apiKey.trim()===""){throw new a.SourceCreationError("props.apiKey must be a string")}babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(i),qe,s.load(e.apiKey,e.sourceLanguageId));babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(i),Ze,new be({googleSource:babelHelpers.assertThisInitialized(i),languageId:babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(i),Ke)}));babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(i),Qe,new z({googleSource:babelHelpers.assertThisInitialized(i),languageId:babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(i),Ke)}));babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(i),$e,new Le({googleSource:babelHelpers.assertThisInitialized(i),map:babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(i),Ze)}));babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(i),Je,new Ye({googleSource:babelHelpers.assertThisInitialized(i),map:babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(i),Ze)}));return i}babelHelpers.createClass(r,[{key:"sourceCode",get:function e(){return r.code}},{key:"loaderPromise",get:function e(){return babelHelpers.classPrivateFieldGet(this,qe)}},{key:"map",get:function e(){return babelHelpers.classPrivateFieldGet(this,Ze)}},{key:"autocompleteService",get:function e(){return babelHelpers.classPrivateFieldGet(this,Qe)}},{key:"photoService",get:function e(){return babelHelpers.classPrivateFieldGet(this,$e)}},{key:"geocodingService",get:function e(){return babelHelpers.classPrivateFieldGet(this,Je)}},{key:"languageId",get:function e(){return babelHelpers.classPrivateFieldGet(this,Ke)}}]);return r}(a.BaseSource);babelHelpers.defineProperty(et,"code","GOOGLE");e.Google=et})(this.BX.Location.Google=this.BX.Location.Google||{},BX,BX.Location.Core);
//# sourceMappingURL=google.bundle.map.js